// pages/index/index.js
const app = getApp();
const db = wx.cloud.database();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    src:"",
    today_hot:null
  },
  get:function(e){
    console.log(e);
  },
  onLoad: function (options) {
    let that=this;;
    db.collection('today_hot').get().then(res => {
      console.log(res.data);
      that.setData({
        today_hot:res.data
      })
    })
  },
  goUsershop:function(e){
    wx.navigateTo({
      url: '../usershop/usershop',
    })
  },
  //搜索框  确认搜索
  onSearch:function(e){
    let name=e.detail;
    wx.redirectTo({
      url: '../search_result/search_result?name=' + name,
    })
  },
  //搜索框取消搜索
  onCancel:function(){

  },
  shuma:function(){
    this.setData({
      today_hot:[]
    })
  }
})